<!DOCTYPE html>
<html>
<head>
	<title>数组求平均值</title>
</head>
<body>
	<script type="text/javascript"> 
		function getAvg(){
			var sum=0,len=arguments.length,i;
			for(i=0;i<len;i++)
			{
				sum+=arguments[i]; 
			}
			console.log(sum);
			return sum/len;
		}
		var avg=getAvg(1,2,3,4,5);
		console.log(avg);
	</script>
</body>
</html>